//
//  CommentChinaTableViewCell.m
//  GoodBuy
//
//  Created by dlios on 15-5-16.
//  Copyright (c) 2015年 GoodBuy. All rights reserved.
//

#import "CommentChinaTableViewCell.h"

@implementation CommentChinaTableViewCell
- (void)dealloc
{
    [_floor release];
    [_format_date release];
    [_comment_ID release];
    [_head release];
    [_user_smzdm_id release];
    [_comment_content release];
    [_comment_author release];
    [_user_id release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
    
}
- (void)createSubviews
{
    //去掉点击效果
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    //----------
//    self.user_smzdm_id = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
//    _user_smzdm_id.backgroundColor = [UIColor magentaColor];
//    [self.contentView addSubview:_user_smzdm_id];
//    [_user_smzdm_id release];
    //---------时间
    self.format_date = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width - 140, 40, 140, 30)];
    _format_date.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:_format_date];
    [_format_date release];
    //--------评论者
    self.comment_author = [[UILabel alloc] initWithFrame:CGRectMake(80, 10, 130, 30)];
    _comment_author.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:_comment_author];
    [_comment_author release];
    //-----------用户ID
    
    self.user_id = [[UILabel alloc] initWithFrame:CGRectMake(80, 40, 130, 30)];
    _user_id.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:_user_id];
    [_user_id release];
    
    //--------------内容
    self.comment_content = [[UILabel alloc] initWithFrame:CGRectMake(10, 80, [UIScreen mainScreen].bounds.size.width - 20, 80)];
    _comment_content.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:_comment_content];
    [_comment_content release];
    // -----头像-----------
    self.head = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 60, 60)];
    _head.backgroundColor = [UIColor blackColor];
    [self.contentView addSubview:_head];
    [_head release];
    //
//    self.comment_ID = [[UILabel alloc] initWithFrame:CGRectMake(110, 40, 100, 30)];
//    _comment_ID.backgroundColor = [UIColor redColor];
//    [self.contentView addSubview:_comment_ID];
//    [_comment_ID release];
    // 楼层
    self.floor = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width - 110, 10, 100, 30)];
    _floor.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_floor];
    [_floor release];
    
    
}
- (void)setComment:(ChinaCommentlei *)comment
{
    NSURL *url = [NSURL URLWithString:comment.head];
//    [_head sd_]
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
